{{template "header"}}
<title>文章——我的11go_http</title>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
    {{template "nav" .}}
    <div class="container">
        <h1>文章列表</h1>
        <a href="/topic/add" class="btn btn-default">添加文章</a>
        <table class="table table-striped">
            <thead>
                <tr>
                    <th>#</th>
                    <th>文章名称</th>
                    <th>最后更新</th>
                    <th>浏览</th>
                    <th>回复数</th>
                    <th>最后回复时间</th>
                    <th>操作1</th>
                </tr>
            </thead>
                {{range .Topics}}
                    <tbody>
                    <th>{{.Id}}</th>
                    <th><a href="/topic/view/id/{{.Id}}">{{.Title}}</a></th>
                    <th>{{.Updated |mydateform}}</th>
                    <th>{{.View}}</th>
                    <th>{{.ReplyCount }}</th>
                    <th>{{.ReplyTime |mydateform}}</th>
                    <th><a href="/topic?op=del&id={{.Id}}">删除</a></th>
                    </tbody>
            {{end}}
        </table>
    </div>


    <script type ="text/javascript">
    function addCate() {
    var catename = document.getElementById("catename");
    if (catename.value.length ==0){
    alert("请输入分类名称")
    return false
    }

    var pwd = document.getElementById("pwd");
    if(pwd.value.length ==0){
    alert("请输入棉麻")
    return false
    }
    return true

    }

    function backHome() {
    window.location.href="/"
    return false
    }
    </script>
    <script type="text/javascript" src="http://code.jquery.com/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" src="/static/plugin/bootstrap/dist/js/bootstrap.js"></script>

</nav></body>
</html>
